<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>

    



      <script>

      test='<%- test%>'
      test=JSON.parse(test)
      console.log(test)

</script>
<script src="http://zeptojs.com/zepto.min.js"></script>
</script>

<script>


    function onBridgeReady(){
   WeixinJSBridge.invoke(
       'getBrandWCPayRequest', {
           "appId":test.appId,     //公众号名称，由商户传入     
           "timeStamp":test.timestamp,         //时间戳，自1970年以来的秒数     
           "nonceStr":test.nonceStr, //随机串     
           "package":test.package,     
           "signType":"MD5",         //微信签名方式：     
           "paySign":test.paySign //微信签名 
       },
       function(res){     
          
           if(res.err_msg == "get_brand_wcpay_request:ok" ) {
             alert('已经支付成功')
             location.href="/jd_mobile?order=page5&from=wechat"
                            
           }
              // 使用以上方式判断前端返回,微信团队郑重提示：res.err_msg将在用户支付成功后返回    ok，但并不保证它绝对可靠。 
       }
   ); 
}
if (typeof WeixinJSBridge == "undefined"){
   if( document.addEventListener ){
       document.addEventListener('WeixinJSBridgeReady', onBridgeReady, false);
   }else if (document.attachEvent){
       document.attachEvent('WeixinJSBridgeReady', onBridgeReady); 
       document.attachEvent('onWeixinJSBridgeReady', onBridgeReady);
   }
}else{
   onBridgeReady();
}
</script>
</head>
<body>
    
</body>
</html>